.title_wrapper
  %h2 Utilities: Bundles

%h3 
  View
  = h @bundles.name
  
.detail_view

  %h4
    View Bundle Details

  %p
    .label
      Name:
    = h @bundles.name
  %p
    .label
      Description:
    = h @bundles.description
  %p
    .label
      Status:
    = h @bundles.status
  %p
    .label
      Created at:
    = h @bundles.created_at.strftime("%b. %d, %Y %H:%M")
  %p
    .label
      Updated at:
    = h @bundles.updated_at.strftime("%b. %d, %Y %H:%M")
    
    
  %br
  %br
  %h3
    Bundle Variations

  .table_view   
    %table
      %tr
        %th
          Id
        %th
          Frequency
        %th
          Price
        %th
          Trial Period
        %th
          Need Credit Card
        %th
          Status
        %th
          Created at
        %th
          Updated at
        - @bundles.bundle_variations.each do |bv|
          %tr
            %td
              = h bv.id
            %td
              = h bv.frequency.capitalize
            %td
              = h number_to_currency(bv.price)
            - if bv.trial_period
              %td
                = h pluralize(bv.trial_period.period, bv.trial_period.frequency)
              %td
                = h bv.trial_period.need_credit_card
            - else
              %td
              %td
            %td
              = h bv.status.capitalize
            %td
              = h bv.created_at.strftime("%b. %d, %Y %H:%M")
            %td
              = h bv.updated_at.strftime("%b. %d, %Y %H:%M")
  %br
  %h3
    Publications

  .table_view   
    %table
      %tr
        %th
          Id
        %th
          Name
        %th
          Editor
        %th
          Email
        %th
          Description
        %th
          Url
        %th
          Status
        - @bundles.publications.each do |p|
          %tr
            %td
              = h p.id
            %td
              = h p.name
            %td
              = h p.editor
            %td
              = h p.email
            %td
              = h p.description
            %td
              = h p.url
            %td
              = h p.status
    
= link_to 'Edit', edit_bundle_path(@bundles)
|
= link_to 'Back', bundles_path
